<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>


<script>
    var num=prompt("请输入一个三位数");
    var first=parseInt(num /100);
    var second=parseInt(num /10)%10;
    var third=num %10;
    if(!isNaN(num) && num)
    {
        if(num /100 >=1 && num/1000<1){
            if(num==first*first*first+second*second*second+third*third*third){
                console.log("你输入的是一个水仙花数");  
            }else{
                console.log("你输入的不是一个水仙花数");
            }
        }else{
         console.log("你输入的不是一个4位数字");
             }
    }else{
        console.log("你输入的不是一个数");
    }
</script>